<div class="page-toolbar">
    <div class="page-filter fr">
        <form class="layui-form layui-form-pane" action="{:url()}" method="get" id="hisi-table-search">
            <div class="layui-form-item">
                <label class="layui-form-label">搜索</label>
                <div class="layui-input-inline">
                    <input type="text" name="keyword" lay-verify="required" placeholder="输入关键词搜索" class="layui-input">
                </div>
            </div>
        </form>
    </div>
    <div class="layui-btn-group fl">
        <!--<a href="{:url('add')}" class="layui-btn layui-btn-primary layui-icon layui-icon-add-circle-fine">&nbsp;添加</a>-->
        <!--<a data-href="{:url('status?val=1')}" class="layui-btn layui-btn-primary j-page-btns layui-icon layui-icon-play" data-table="dataTable">&nbsp;启用</a>-->
        <!--<a data-href="{:url('status?val=0')}" class="layui-btn layui-btn-primary j-page-btns layui-icon layui-icon-pause" data-table="dataTable">&nbsp;禁用</a>-->
        <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm layui-icon layui-icon-close red">&nbsp;删除</a>
    </div>
</div>
<table id="dataTable"></table>
{include file="system@block/layui" /}
<script type="text/html" title="操作按钮模板" id="buttonTpl">
    <a href="{:url('edit')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal">修改</a><a href="{:url('del')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-danger j-tr-del">删除</a>
</script>
<script type="text/html" title="图片" id="img">
    <img src="{{d.img}}" alt="">
</script>

<!--昵称-->
<script type="text/html" title="昵称" id="nickname">
    {{d.userinfo.nickname}}
</script>

<!--电话-->
<script type="text/html" title="电话" id="phone">
    {{d.user.phone}}
</script>

<!--状态-->
<script type="text/html" title="电话" id="status">
    <div></div>
</script>


<script type="text/javascript">
    layui.use(['table'], function() {
        var table = layui.table;
        table.render({
            elem: '#dataTable'
            ,url: '{:url('', input('get.'))}' //数据接口
            ,page: true //开启分页
            ,skin: 'row'
            ,even: true
            ,limit: 20
            ,text: {
                none : '暂无相关数据'
            }
            ,cols: [[ //表头
                {type:'checkbox'}
                ,{field: 'classify', title: '分类名称',width: 160}
                ,{field: 'uid', title: '用户id',width:80}
                ,{field: 'nickname', title: '用户昵称',width:180,templet:'#nickname'}
                ,{field: 'phone', title: '电话',width:180,templet:'#phone'}
                ,{field: 'title', title: '标题',width:200}
                ,{field: 'img', title: '图片',width:180,templet:'#img'}
                ,{field: 'content', title: '详情'}
                ,{field: 'addr', title: '详情地址'}
                ,{field: 'create_time', title: '创建时间'}
                // ,{field: 'status', title: '状态',templet:"#status"}
                ,{field: 'status', title: '状态',templet:function (d) {
                        if(d.status==0){
                            return '已取消'
                        }else if(d.status==1){
                            return '招聘中'
                        }else if(d.status==2){
                            return '已完成'
                        }
                    }}
                ,{title: '操作', width: 160, templet: '#buttonTpl'}
            ]]
        });
    });
</script>